24 #define foreach(x, v) for (typeof (v).begin() x=(v).begin(); x !=(v).end(); ++x)
25 #define For(i, a, b) for (int i=(a); i<(b); ++i)
26 #define D(x) cout << #x " is " << x << endl
28 const double EPS
= 1e-9;
29 int cmp(double x
, double y
= 0, double tol
= EPS
) {
30 return (x
<= y
+ tol
) ? (x
+ tol
< y
) ? -1 : 0 : 1;
36 vector
<int> A
[2 * MAXN
], B
[2 * MAXN
];
41 for (int i
= 0; i
< n
; ++i
) {
42 for (int j
= 0; j
< n
; ++j
) {
43 scanf("%d", &mat
[i
][j
]);
47 for (int i
= 0; i
< n
; ++i
) {
48 for (int j
= 0; j
< n
; ++j
) {
49 for (int delta
= 0; i
+ delta
< n
and j
+ delta
< n
; ++delta
) {
51 for (int k
= 0; k
<= delta
; ++k
) {
52 option
+= mat
[i
+k
][j
+k
];
53 option
-= mat
[i
+k
][j
+delta
-k
];
55 ans
= max(option
, ans
);